package com.sxhnpg.web.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;
import org.apache.struts2.ServletActionContext;

import com.sxhnpg.constant.Constants;
import com.sxhnpg.exception.SxhnpgException;

public class BaseAction {
	
	private static Logger logger = Logger.getLogger(BaseAction.class);  
	
	public String goLoginPage() throws SxhnpgException{
		try{
			HttpServletRequest request =  ServletActionContext.getRequest();
			HttpServletResponse respons = ServletActionContext.getResponse();
			String contextPath = request.getContextPath();
			// 强制返回系统首页
			respons.sendRedirect(contextPath);
			return null;
		}catch(Exception e) {
			logger.error("跳转到登陆页面失败",e);
			throw new SxhnpgException();
		}
		
	}
}
